package org.window;

import com.scm.all.export.SystemUtils;
import com.scm.all.export.WindowOperationUtils;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;

/**
 * 内存读写测试
 */
public class PaneControllerAndHBoxStateAndButtonAbout {
    public static Button button = new Button();
    public static void init(){
        button.setText("关于作者");
        button.setPrefWidth(80);
        button.setPrefHeight(20);
        button.setBackground(new Background(new BackgroundImage(new Image("bgk.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
        button.setStyle("-fx-text-fill: #ffffff");
//        button.setDisable(true);
        button.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setBackground(new Background(new BackgroundImage(new Image("bgk2.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
            }
        });
        button.setOnMouseExited(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setBackground(new Background(new BackgroundImage(new Image("bgk.jpg"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
            }
        });
        button.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                SystemUtils.messageBoxExW(WindowOperationUtils.windowGetHwnd(),"本项目是鲤城区蜗牛猫软件开发工作室 研发，用于项目学习开源，转载请备注，基于JNI技术:1012518027@qq.COM  官网：www.Snailcatmall.com   QQ群:128828632","温馨提示",0);
            }
        });
    }
}
